//
//  YsNoteSDKNetWork.h
//  YsNoteSDK
//
//  Created by 宋宏康 on 2020/3/21.
//

#import <Foundation/Foundation.h>
#import <YsToolsManager/YsToolsManager.h>

NS_ASSUME_NONNULL_BEGIN

/** 成功回调 */
typedef void (^SuccessBlock) (YsToolsManagerResultModel *responseObject);
/** 失败回调 */
typedef void (^FailedBlock) (id error);

@interface YsNoteSDKNetWorkManager : NSObject
/// 1. 获取通道
/// @param uid 用户的平台uid
/// @param successfull 成功回调
/// @param failed 失败回调
+ (NSURLSessionDataTask *)uploadFetchWayWithuid:(NSString *)uid
                                        success:(void (^)(YsToolsManagerResultModel *result))successfull
                                           fail:(void (^)(NSError *error))failed;

/// 智能笔记-获取用户笔记本列表
/// @param user_fkcode 用户外键
/// @param successfull 成功
/// @param failed 失败
+ (NSURLSessionDataTask *)noteBooks:(NSString *)user_fkcode
                            success:(void (^)(YsToolsManagerResultModel *result))successfull
                               fail:(void (^)(NSError *error))failed;


/// 教师端校内版免密登录
/// @param accountCode accountCode
/// @param successful 成功
/// @param failed 失败
+ (NSURLSessionDataTask *)requestGetLoginInSchoohWithUserAccountCode:(NSString *)accountCode
                                                             success:(void (^)(YsToolsManagerResultModel *result))successful
                                                                fail:(void (^)(NSError *error))failed;

/// 智能笔记-获取用户笔记本的笔记列表
/// @param user_fkcode 用户外键
/// @param book_fkcode 笔记本外键
/// @param page_no 页码
/// @param page_size 页面数据页面数据
/// @param note_type 必填(1.普通笔记 2.特殊笔记)
/// @param successfull 成功
/// @param failed 失败
+ (NSURLSessionDataTask *)userNoteBooksList:(NSString *)user_fkcode
                                book_fkcode:(NSString *)book_fkcode
                                    page_no:(NSString *)page_no
                                  page_size:(NSString *)page_size
                                  note_type:(NSString *)note_type
                            success:(void (^)(YsToolsManagerResultModel *result))successfull
                                       fail:(void (^)(NSError *error))failed;


/// 下载接口
/// @param downloadURL 下载的URL
/// @param completionHandler 完成的回调
+ (NSURLSessionDownloadTask *)downloadURL:(NSString *)downloadURL
                            path:(NSString *)path
                        completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler;

@end

NS_ASSUME_NONNULL_END
